package com.hotline.communication.service.impl;


import com.hotline.communication.mapper.CallOperationDetailMapper;
import com.hotline.communication.dto.CallOperationDetailDTO;
import com.hotline.communication.service.CallOperationDetailService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
@Slf4j
public class CallOperationDetailServiceImpl implements CallOperationDetailService {

    @Resource
    private CallOperationDetailMapper callOperationDetailMapper;

    @Override
    public void insert(CallOperationDetailDTO callOperationDetailDTO){
        try {
            log.info("TX_LOG[]call_operation_detail[]按键轨迹[]新增按键轨迹[]callOperationDetailDTO:{}",callOperationDetailDTO);
            callOperationDetailMapper.insert(callOperationDetailDTO);
        }catch (Exception e){
            log.error("新增按键轨迹失败, callOperationDetail={}, cause:{}", callOperationDetailDTO,e.getMessage());
        }
    }

    /**
     * 新加的ivr上的方法
     * @param callOperationDetailDTO
     * @return
     */
    @Override
    public void insertIvr(CallOperationDetailDTO callOperationDetailDTO) {
        try {
            log.info("TX_LOG[]call_operation_detail[]按键轨迹[]新增按键轨迹[]callOperationDetailDTO:{}",callOperationDetailDTO);
            callOperationDetailMapper.insertIvr(callOperationDetailDTO);
        }catch (Exception e){
            log.error("新增按键轨迹失败, callOperationDetail={}, cause:{}", callOperationDetailDTO,e.getMessage());
        }
    }
}
